package com.jhinwins.equipmenteb.equipmentebserver.entity;

import com.jhinwins.equipmenteb.equipmentebserver.entity.common.GenerateId;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 订单表
 */
@Entity
@Table(name = "t_order")
public class OrderBean extends GenerateId {
    /**
     * 未付款
     */
    public static final String STATE_UNPAID = "unpaid";
    /**
     * 已付款，使用中，未归还
     */
    public static final String STATE_USING = "paid_using";
    /**
     * 归还申请中
     */
    public static final String STATE_APPLYING = "paid_applying";
    /**
     * 已归还，已完成订单
     */
    public static final String STATE_FINISH = "paid_finish";

    @ManyToOne
    private UserBean userBean;
    @ManyToOne
    private InventoryBean inventoryBean;
    /**
     * 租赁数量
     */
    private Integer count;
    /**
     * 租赁时长(天)
     */
    private Integer tenancy;
    /**
     * 租赁时间
     */
    private Long time;
    /**
     * 送货地址
     */
    private String address;
    /**
     * 状态
     */
    private String state;

    public OrderBean() {
    }

    public OrderBean(Long id) {
        super(id);
    }

    public UserBean getUserBean() {
        return userBean;
    }

    public void setUserBean(UserBean userBean) {
        this.userBean = userBean;
    }

    public InventoryBean getInventoryBean() {
        return inventoryBean;
    }

    public void setInventoryBean(InventoryBean inventoryBean) {
        this.inventoryBean = inventoryBean;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Integer getTenancy() {
        return tenancy;
    }

    public void setTenancy(Integer tenancy) {
        this.tenancy = tenancy;
    }

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }
}
